package com.zs4sdk.entity;


import com.common.library.entity.JSONResultEntity;
import com.common.library.util.Helper;

import org.json.JSONException;
import org.json.JSONObject;

/**
 * 
 * function: 现在支付订单返回json类
 * 
 * @ author: aXiBa
 */
public class XZOrderResultEntity extends JSONResultEntity {



	public static final String COLUMN_ERRCODE = "errcode";
	public static final String COLUMN_MESSAGE = "message";

	public static final String COLUMN_XZ_APPID = "appId";
	public static final String COLUMN_XZ_MHTORDERNO = "mhtOrderNo";
	public static final String COLUMN_XZ_MHTORDERNAME = "mhtOrderName";
	public static final String COLUMN_XZ_MHTORDERTYPE = "mhtOrderType";
	public static final String COLUMN_XZ_MHTCURRENCYTYPE = "mhtCurrencyType";
	public static final String COLUMN_XZ_MHTORDERAMT = "mhtOrderAmt";
	public static final String COLUMN_XZ_MHTORDERDETAIL = "mhtOrderDetail";
	public static final String COLUMN_XZ_NOTIFYURL = "notifyUrl";
	public static final String COLUMN_XZ_MHTCHARSER = "mhtCharset";
	public static final String COLUMN_XZ_MHTSIGNTYPE = "mhtSignType";


	private String message = "";
	private String errcode = "";


	private String xzappid = "";
	private String mhtOrderNo = "";
	private String mhtOrderName = "";
	private String mhtOrderType = "";
	private String mhtCurrencyType = "";
	private String mhtOrderAmt = "";
	private String mhtOrderDetail = "";
	private String notifyUrl = "";
	private String mhtCharset = "";
	private String mhtSignType = "";



	/**
	 * 构造方法
	 */
	public XZOrderResultEntity(){

	}
	/**
	 * 构造方法
	 * @param json
	 */
	public XZOrderResultEntity(JSONObject json){
		this.fromJSON(json);
	}
	/**
	 * 构造方法
	 * @param jsonStr
	 */
	public XZOrderResultEntity(String jsonStr){
		try{
			this.fromJSON(new JSONObject(jsonStr));
		}catch (Exception e) {
			e.printStackTrace();
		}
	}

	//#endregion 构造方法

	//#region Override方法
	@Override
	public JSONObject toJSON() {
		JSONObject result = super.toJSON();
		try {
			result.put(COLUMN_MESSAGE, this.message);
			result.put(COLUMN_ERRCODE, this.errcode);
			//现在支付
			result.put(COLUMN_XZ_APPID, this.xzappid);
			result.put(COLUMN_XZ_MHTORDERNO, this.mhtOrderNo);
			result.put(COLUMN_XZ_MHTORDERNAME, this.mhtOrderName);
			result.put(COLUMN_XZ_MHTORDERTYPE, this.mhtOrderType);
			result.put(COLUMN_XZ_MHTCURRENCYTYPE, this.mhtCurrencyType);
			result.put(COLUMN_XZ_MHTORDERAMT, this.mhtOrderAmt);
			result.put(COLUMN_XZ_MHTORDERDETAIL, this.mhtOrderDetail);
			result.put(COLUMN_XZ_NOTIFYURL, this.notifyUrl);
			result.put(COLUMN_XZ_MHTCHARSER, this.mhtCharset);
			result.put(COLUMN_XZ_MHTSIGNTYPE, this.mhtSignType);
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return result;
	}
	
	@Override
	public void fromJSON(JSONObject json) {
		super.fromJSON(json);
		if (Helper.isNotEmpty(json)) {
			try {
				this.message = json.optString(COLUMN_MESSAGE);
				this.errcode = json.optString(COLUMN_ERRCODE);
				//现在支付
				this.xzappid = json.optString(COLUMN_XZ_APPID);
				this.mhtOrderNo = json.optString(COLUMN_XZ_MHTORDERNO);
				this.mhtOrderName = json.optString(COLUMN_XZ_MHTORDERNAME);
				this.mhtOrderType = json.optString(COLUMN_XZ_MHTORDERTYPE);
				this.mhtCurrencyType = json.optString(COLUMN_XZ_MHTCURRENCYTYPE);
				this.mhtOrderAmt = json.optString(COLUMN_XZ_MHTORDERAMT);
				this.mhtOrderDetail = json.optString(COLUMN_XZ_MHTORDERDETAIL);
				this.notifyUrl = json.optString(COLUMN_XZ_NOTIFYURL);
				this.mhtCharset = json.optString(COLUMN_XZ_MHTCHARSER);
				this.mhtSignType = json.optString(COLUMN_XZ_MHTSIGNTYPE);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}

	/**
	 * 是否成功
	 */
	public String getErrcode() {
		return errcode;
	}

	public void setErrcode(String errcode) {
		this.errcode = errcode;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}


	public String getMhtCharset() {
		return mhtCharset;
	}

	public void setMhtCharset(String mhtCharset) {
		this.mhtCharset = mhtCharset;
	}

	public String getMhtCurrencyType() {
		return mhtCurrencyType;
	}

	public void setMhtCurrencyType(String mhtCurrencyType) {
		this.mhtCurrencyType = mhtCurrencyType;
	}

	public String getMhtOrderAmt() {
		return mhtOrderAmt;
	}

	public void setMhtOrderAmt(String mhtOrderAmt) {
		this.mhtOrderAmt = mhtOrderAmt;
	}

	public String getMhtOrderDetail() {
		return mhtOrderDetail;
	}

	public void setMhtOrderDetail(String mhtOrderDetail) {
		this.mhtOrderDetail = mhtOrderDetail;
	}

	public String getMhtOrderName() {
		return mhtOrderName;
	}

	public void setMhtOrderName(String mhtOrderName) {
		this.mhtOrderName = mhtOrderName;
	}

	public String getMhtOrderNo() {
		return mhtOrderNo;
	}

	public void setMhtOrderNo(String mhtOrderNo) {
		this.mhtOrderNo = mhtOrderNo;
	}

	public String getMhtOrderType() {
		return mhtOrderType;
	}

	public void setMhtOrderType(String mhtOrderType) {
		this.mhtOrderType = mhtOrderType;
	}

	public String getMhtSignType() {
		return mhtSignType;
	}

	public void setMhtSignType(String mhtSignType) {
		this.mhtSignType = mhtSignType;
	}

	public String getNotifyUrl() {
		return notifyUrl;
	}

	public void setNotifyUrl(String notifyUrl) {
		this.notifyUrl = notifyUrl;
	}

	public String getXzappid() {
		return xzappid;
	}

	public void setXzappid(String xzappid) {
		this.xzappid = xzappid;
	}
}
